#include <iostream>
#include <string>
using namespace std;

class Building {
    friend class Good_Friend; //Good_Friend类是好友， 可以访问Building类的私有属性
public:
    string m_SettingRoom;
    Building();

private:
    string m_BedRoom;
};

class Good_Friend {
public:
    Good_Friend();
    void visit(); // 访问Building中的属性

private:
    Building * building; //类外实现构造函数
};

//类外实现构造函数
Building :: Building() {
    m_SettingRoom = "客厅";
    m_BedRoom = "卧室";
}

Good_Friend :: Good_Friend() {
    //创建建筑物对象
    building = new Building();
}

void Good_Friend :: visit() {
    cout << "Good_Friend can visit " << building->m_SettingRoom << endl;
    cout << "Good_Friend can visit " << building->m_BedRoom << endl;
}


void test01() {
    Good_Friend g;
    g.visit();
}
int main() {
    test01();
    return 0;
}